<template>
  <div class="app-container">
  <el-form ref="form" :model="form" label-width="80px">
  <el-form-item label="店铺名称">
    <el-input v-model="form.shopname" style="width:300px"></el-input>
  </el-form-item>

 <el-form-item label="店铺地址" >
    <el-input v-model="form.address"  style="width:300px"></el-input>
  </el-form-item>
 
 
  <el-form-item>
    <el-button type="primary" @click="onSubmit">立即设置</el-button>
  </el-form-item>
</el-form>
  </div>
</template>

<script>
import { information, inform} from '@/api/appid'
export default {
 data() {
      return {
        form: {  }
      }
    },
    mounted(){

      //通过请求检查登录状态
      // 拿到数据赋值给空对象
        inform().then(res=>{
            // console.log(res);
          this.form = res.data
        })

    },
    methods: {
      onSubmit() {
        //点击立即设置的时候触发此方法
        information({shopname:this.form.shopname,address:this.form.address}).then(res=>{
          //提示设置成功
      this.$message({ type: 'success',message: '设置成功!'  });
       inform().then(res=>{
          this.form = res.data
        })

        })
     
      }
    }
}
</script>

<style>

</style>